package org.linlinjava.litemall.db.service;

import org.linlinjava.litemall.db.dao.LitemallHistoriesMapper;
import org.linlinjava.litemall.db.domain.LitemallHistories;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class LitemallHistoriesService {
    @Resource
    private LitemallHistoriesMapper historiesMapper;

    public List<LitemallHistories> getHistoryRecords(int userId) {
        return historiesMapper.getHistoryRecords(userId);
    }

    public void insert(LitemallHistories histories) {
        historiesMapper.insert(histories);
    }

    public void updateHistory(LitemallHistories histories) {
        historiesMapper.updateHistory(histories);
    }

    public int getHistoryCount(int userId) {
        return historiesMapper.getHistoryCount(userId);
    }

    public int clearUserHistory(int userId) {
        return historiesMapper.clearUserHistory(userId);
    }
}
